package com.biz.primus.ms.cart.feign;

import com.biz.primus.base.vo.StockRespVo;
import com.biz.primus.model.stock.vo.MeetStockRespVo;
import com.biz.primus.model.stock.vo.ProvinceStockReqVo;
import com.biz.primus.model.stock.vo.StocksReqVo;
import com.biz.primus.ms.cart.degraded.DegradedStockFeignClient;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * StockFeignClient
 *
 * @author JKLiues
 * @date 2017年11月10日
 */
@FeignClient(qualifier = "stockFeignClient", name = "service-depot", fallback = DegradedStockFeignClient.class)
public interface StockFeignClient {

    /**
     * 获取满足商品数量的门店
     *
     * @param reqVo 请求
     * @return MeetStockRespVo
     */
    @PostMapping(value = "soa/depotService/getMeetStock")
    MeetStockRespVo getMeetStock(@RequestBody ProvinceStockReqVo reqVo);

    /**
     * 获取商品库存
     *
     * @param reqVo 商品数量
     * @return List<StockRespVo>
     */
    @PostMapping(value = "soa/depotService/getDepotStockInBatch")
    List<StockRespVo> getDepotsStockInBatch(@RequestBody StocksReqVo reqVo);
}